/**
 * Campaing class
 *
 * @author Jose Luis Quintana <joseluis@lbn.pe>
 **/

var Campaing = new Class({
    Extends: Main,
    Implements: [Events, Options],
    options: {
    
    },
    
    slideshow: $('slideshow'),
    
    initialize: function(options){
        this.parent();
        this.setOptions(options);
        this.setEvents();
        this.setSlideshow();
    },
    setEvents: function(){
        window.addEvent('resize', this.onResize.bind(this)).fireEvent('resize');
    },
    setSlideshow: function(){
        this.images = [
        '/img/muscs_logo_liggende.jpg',
        '/img/muscs_stolthet.jpg',
        '/img/muscs_naerhet.jpg',
        '/img/muscs_logo.jpg'];
        
        this.slider = new uSlider(this.slideshow, {
            directionnav: true,
            controlnav: false,
            resize: false,
            centercrop: true
        });
        
//        this.slider.start();
    },
    onResize: function(){
        this.slideshow.setStyles({
            'width': this.getSizeContainer().x,
            'height': this.getSizeContainer().y
        });
        
        if (this.slider) {
            this.slider.resize();
        }
    }
});

document.addEvent('domready', function(){
    new Campaing();
});